Let’s Visualize
In this workshop, we aim to explore the various ways of accessing graphical software and utilizing Graphical User Interfaces (GUI) on Hoffman2, an HPC system. This workshop is designed for researchers, data scientists, and anyone interested in leveraging HPC for visualization tasks.
We will cover:
This presentation and accompanying materials are available on 🔗 UCLA OARC GitHub Repository
You can view the slides in:
Each file provides detailed instructions and examples on the various topics covered in this workshop.
Note: 🛠️ This presentation was built using Quarto and RStudio.
On Hoffman2, typically you would login to a terminal and interact via a Command Line Interface (CLI). However, there are instances where you might want to visualize data or interact with a GUI interface. We will explore various methods to accomplish this, highlighting the benefits and potential challenges of each approach.
We will go over some ways you can do this
X11 forwarding lets you run graphical applications installed on a remote server and see the graphics on your local machine.
It’s a protocol often used in Unix-like operating systems for sending graphical applications over a network.
Tip
You’ll need to install and setup X11 on your local computer to render the graphics.
If you have a Windows computer, there are many applications that can enable X11 Forwarding
Windows Subsystem for Linux: A Windows native compatibility layer for running Linux binaries on Windows.
MobaXterm: MobaXterm is a free, enhanced terminal for Windows with X11 server, SSH client, network tools, and much more.
Xming: Xming is X Window System Server for Microsoft.
Cygwin: Cygwin is a free Linux-like environment for Windows. To add Cygwin/X server, select the xinit package from the X11 category.
ssh -Y joebruin@hoffman2.idre.ucla.edu-Y option in SSH enables X11 forwardingwsl --installssh -Y joebruin@hoffman2.idre.ucla.eduFor Mac users, XQuartz is a popular application that supports X windows.
This is a terminal application that facilitates a connection to Hoffman2 with X11 Forwarding enabled.
Once installed, to connect to Hoffman2 and enable X11 Forwarding, run ssh with the -Y option:
NoMachine provides remote desktop functionality on Hoffman2, enabling a Graphical User Interface (GUI) on a remote machine.
AddName for your connectionHost should be nx.hoffman2.idre.ucla.eduPort to 22 and choose SSH for ProtocolVerify host identification
OKUsername and PasswordCreate a new desktop
Create a new Mate virtual desktopqrsh -l h_data=10GJupyter can be executed on Hoffman2. This process involves running the jupyter notebook/lab command on a Hoffman2 node, forwarding the Jupyter port to your local machine, and accessing Jupyter via your local web browser.
However, for a more streamlined experience, we have created a script, h2jupynb, which automatically creates a Jupyter session on a Hoffman2 compute node.
Ensure Python is installed on your local machine before executing the script:
The above command will initiate the script with your Hoffman2 username (replace “joebruin” with your username), a duration of 5 hours (-t 5), memory request of 10 GB (-m 10), and specify the architecture as “intel-gold”.
Usage:
h2jupynb [-u <Hoffman2 user name>] [-v <python-version>]
[-t <time, integer number of hours>] [-m <memory, integer number of GB per core>]
[-e <parallel environment: 1 for shared, 2 for distributed>] [-s <number of slots>]
[-o <run on group owned nodes: yes/no>] [-x <run on an exclusively reserved node: yes/no>]
[-a <CPU-type>] [-d <path to directory from which the jupyter NB/lab will start>]
[-g <run on a gpu node: yes/no>] [-c <gpu-card-type>] [-l <cuda-version>]
[-p <port number>]To use your Anaconda environment created on Hoffman2 with the h2jupynb script, you’ll need to install ipykernel in your Anaconda environment.
Let’s say your Anaconda environment is named myconda. Follow the steps below on Hoffman2:
Request an interactive session with 10GB of memory for 1 hour:
Load Anaconda and activate your environment:
Install ipykernel and add it to your environment:
Run the h2jupynb script on your local machine using the -v anaconda3 option:
Now, myconda should appear in the list of available kernels in Jupyter.
For more information on using Jupyter on Hoffman2, check out our Hoffman2 documentation
You can conveniently interact with Hoffman2 using RStudio Server, allowing you to utilize R in a familiar, intuitive environment.
Find detailed instructions for using RStudio on Hoffman2 on our GitHub page
We’ve also conducted a dedicated workshop on using Rstudio on Hoffman2. Feel free to explore this resource for additional insights and usage tips.
Paraview is an open-source application that supports interactive, scientific visualization.
For using Paraview, you will first need to install ParaView on your local machine.
We will run Paraview on a compute node as a server process. Then use our local install of Paraview to connect to Hoffman2.
Initiate an interactive job on a compute node and load the ParaView module.
qrsh -l h_data=10G
echo $HOSTNAME #Take note of the hostname of the compute node you landed on
module load apptainer
apptainer exec $H2_CONTAINER_LOC/h2-paraview_5.10.0-cpu.sif pvserver --server-port=11111 Leave this terminal open.
Open another local terminal for port forwarding:
Replace nXXXX with the hostname of the compute node and joebruin with your Hoffman2 username.
Connect
localhost:11111